3.52 \(\int (a+b \tan (e+f x)) (c+d \tan (e+f x)) (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=161 \[ -\frac{\log (\cos (e+f x)) (a A d+a B c-a C d+A b c-b B d-b c C)}{f}+x (a (A c-B d-c C)-b (d (A-C)+B c))+\frac{d \tan (e+f x) (a B+A b-b C)}{f}-\frac{(-3 a C d-3 b B d+b c C) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f} \]

[Out]

(a*(A*c - c*C - B*d) - b*(B*c + (A - C)*d))*x - ((A*b*c + a*B*c - b*c*C + a*A*d - b*B*d - a*C*d)*Log[Cos[e + f
*x]])/f + ((A*b + a*B - b*C)*d*Tan[e + f*x])/f - ((b*c*C - 3*b*B*d - 3*a*C*d)*(c + d*Tan[e + f*x])^2)/(6*d^2*f
) + (b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^2)/(3*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.241394, antiderivative size = 161, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.098, Rules used = {3637, 3630, 3525, 3475} \[ -\frac{\log (\cos (e+f x)) (a A d+a B c-a C d+A b c-b B d-b c C)}{f}-x (-a (A c-B d-c C)+b d (A-C)+b B c)+\frac{d \tan (e+f x) (a B+A b-b C)}{f}-\frac{(-3 a C d-3 b B d+b c C) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((b*B*c + b*(A - C)*d - a*(A*c - c*C - B*d))*x) - ((A*b*c + a*B*c - b*c*C + a*A*d - b*B*d - a*C*d)*Log[Cos[e
+ f*x]])/f + ((A*b + a*B - b*C)*d*Tan[e + f*x])/f - ((b*c*C - 3*b*B*d - 3*a*C*d)*(c + d*Tan[e + f*x])^2)/(6*d^
2*f) + (b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^2)/(3*d*f)

Rule 3637

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])
^(n + 1))/(d*f*(n + 2)), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
 + a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] &&  !LtQ[n, -1]

Rule 3630

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (a+b \tan (e+f x)) (c+d \tan (e+f x)) \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac{b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}-\frac{\int (c+d \tan (e+f x)) \left (b c C-3 a A d-3 (A b+a B-b C) d \tan (e+f x)+(b c C-3 b B d-3 a C d) \tan ^2(e+f x)\right ) \, dx}{3 d}\\ &=-\frac{(b c C-3 b B d-3 a C d) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}-\frac{\int (c+d \tan (e+f x)) (3 (b B-a (A-C)) d-3 (A b+a B-b C) d \tan (e+f x)) \, dx}{3 d}\\ &=-(b B c+b (A-C) d-a (A c-c C-B d)) x+\frac{(A b+a B-b C) d \tan (e+f x)}{f}-\frac{(b c C-3 b B d-3 a C d) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}-(-a B c+b c C+b B d+a C d-A (b c+a d)) \int \tan (e+f x) \, dx\\ &=-(b B c+b (A-C) d-a (A c-c C-B d)) x-\frac{(a B c-b c C-b B d-a C d+A (b c+a d)) \log (\cos (e+f x))}{f}+\frac{(A b+a B-b C) d \tan (e+f x)}{f}-\frac{(b c C-3 b B d-3 a C d) (c+d \tan (e+f x))^2}{6 d^2 f}+\frac{b C \tan (e+f x) (c+d \tan (e+f x))^2}{3 d f}\\ \end{align*}

Mathematica [C]  time = 1.5388, size = 161, normalized size = 1. \[ \frac{3 (a+i b) (d-i c) (A+i B-C) \log (-\tan (e+f x)+i)+3 (a-i b) (d+i c) (A-i B-C) \log (\tan (e+f x)+i)+6 d \tan (e+f x) (a B+A b-b C)+\frac{(3 a C d+3 b B d-b c C) (c+d \tan (e+f x))^2}{d^2}+\frac{2 b C \tan (e+f x) (c+d \tan (e+f x))^2}{d}}{6 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Tan[e + f*x])*(c + d*Tan[e + f*x])*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

(3*(a + I*b)*(A + I*B - C)*((-I)*c + d)*Log[I - Tan[e + f*x]] + 3*(a - I*b)*(A - I*B - C)*(I*c + d)*Log[I + Ta
n[e + f*x]] + 6*(A*b + a*B - b*C)*d*Tan[e + f*x] + ((-(b*c*C) + 3*b*B*d + 3*a*C*d)*(c + d*Tan[e + f*x])^2)/d^2
 + (2*b*C*Tan[e + f*x]*(c + d*Tan[e + f*x])^2)/d)/(6*f)

________________________________________________________________________________________

Maple [B]  time = 0.014, size = 334, normalized size = 2.1 \begin{align*}{\frac{C \left ( \tan \left ( fx+e \right ) \right ) ^{3}bd}{3\,f}}+{\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{2}bd}{2\,f}}+{\frac{C \left ( \tan \left ( fx+e \right ) \right ) ^{2}ad}{2\,f}}+{\frac{C \left ( \tan \left ( fx+e \right ) \right ) ^{2}bc}{2\,f}}+{\frac{A\tan \left ( fx+e \right ) bd}{f}}+{\frac{B\tan \left ( fx+e \right ) ad}{f}}+{\frac{B\tan \left ( fx+e \right ) bc}{f}}+{\frac{C\tan \left ( fx+e \right ) ac}{f}}-{\frac{Cbd\tan \left ( fx+e \right ) }{f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Aad}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Abc}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Bac}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Bbd}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) aCd}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Cbc}{2\,f}}+{\frac{A\arctan \left ( \tan \left ( fx+e \right ) \right ) ac}{f}}-{\frac{A\arctan \left ( \tan \left ( fx+e \right ) \right ) bd}{f}}-{\frac{B\arctan \left ( \tan \left ( fx+e \right ) \right ) ad}{f}}-{\frac{B\arctan \left ( \tan \left ( fx+e \right ) \right ) bc}{f}}-{\frac{C\arctan \left ( \tan \left ( fx+e \right ) \right ) ac}{f}}+{\frac{C\arctan \left ( \tan \left ( fx+e \right ) \right ) bd}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)

[Out]

1/3/f*C*b*d*tan(f*x+e)^3+1/2/f*B*tan(f*x+e)^2*b*d+1/2/f*C*tan(f*x+e)^2*a*d+1/2/f*C*tan(f*x+e)^2*b*c+1/f*A*b*d*
tan(f*x+e)+1/f*B*a*d*tan(f*x+e)+1/f*B*b*c*tan(f*x+e)+1/f*C*a*c*tan(f*x+e)-1/f*C*b*d*tan(f*x+e)+1/2/f*ln(1+tan(
f*x+e)^2)*A*a*d+1/2/f*ln(1+tan(f*x+e)^2)*A*b*c+1/2/f*ln(1+tan(f*x+e)^2)*B*a*c-1/2/f*ln(1+tan(f*x+e)^2)*B*b*d-1
/2/f*ln(1+tan(f*x+e)^2)*a*C*d-1/2/f*ln(1+tan(f*x+e)^2)*C*b*c+1/f*A*arctan(tan(f*x+e))*a*c-1/f*A*arctan(tan(f*x
+e))*b*d-1/f*B*arctan(tan(f*x+e))*a*d-1/f*B*arctan(tan(f*x+e))*b*c-1/f*C*arctan(tan(f*x+e))*a*c+1/f*C*arctan(t
an(f*x+e))*b*d

________________________________________________________________________________________

Maxima [A]  time = 1.45627, size = 204, normalized size = 1.27 \begin{align*} \frac{2 \, C b d \tan \left (f x + e\right )^{3} + 3 \,{\left (C b c +{\left (C a + B b\right )} d\right )} \tan \left (f x + e\right )^{2} + 6 \,{\left ({\left ({\left (A - C\right )} a - B b\right )} c -{\left (B a +{\left (A - C\right )} b\right )} d\right )}{\left (f x + e\right )} + 3 \,{\left ({\left (B a +{\left (A - C\right )} b\right )} c +{\left ({\left (A - C\right )} a - B b\right )} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \,{\left ({\left (C a + B b\right )} c +{\left (B a +{\left (A - C\right )} b\right )} d\right )} \tan \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/6*(2*C*b*d*tan(f*x + e)^3 + 3*(C*b*c + (C*a + B*b)*d)*tan(f*x + e)^2 + 6*(((A - C)*a - B*b)*c - (B*a + (A -
C)*b)*d)*(f*x + e) + 3*((B*a + (A - C)*b)*c + ((A - C)*a - B*b)*d)*log(tan(f*x + e)^2 + 1) + 6*((C*a + B*b)*c
+ (B*a + (A - C)*b)*d)*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.15453, size = 348, normalized size = 2.16 \begin{align*} \frac{2 \, C b d \tan \left (f x + e\right )^{3} + 6 \,{\left ({\left ({\left (A - C\right )} a - B b\right )} c -{\left (B a +{\left (A - C\right )} b\right )} d\right )} f x + 3 \,{\left (C b c +{\left (C a + B b\right )} d\right )} \tan \left (f x + e\right )^{2} - 3 \,{\left ({\left (B a +{\left (A - C\right )} b\right )} c +{\left ({\left (A - C\right )} a - B b\right )} d\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 6 \,{\left ({\left (C a + B b\right )} c +{\left (B a +{\left (A - C\right )} b\right )} d\right )} \tan \left (f x + e\right )}{6 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/6*(2*C*b*d*tan(f*x + e)^3 + 6*(((A - C)*a - B*b)*c - (B*a + (A - C)*b)*d)*f*x + 3*(C*b*c + (C*a + B*b)*d)*ta
n(f*x + e)^2 - 3*((B*a + (A - C)*b)*c + ((A - C)*a - B*b)*d)*log(1/(tan(f*x + e)^2 + 1)) + 6*((C*a + B*b)*c +
(B*a + (A - C)*b)*d)*tan(f*x + e))/f

________________________________________________________________________________________

Sympy [A]  time = 0.834445, size = 326, normalized size = 2.02 \begin{align*} \begin{cases} A a c x + \frac{A a d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{A b c \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - A b d x + \frac{A b d \tan{\left (e + f x \right )}}{f} + \frac{B a c \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - B a d x + \frac{B a d \tan{\left (e + f x \right )}}{f} - B b c x + \frac{B b c \tan{\left (e + f x \right )}}{f} - \frac{B b d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{B b d \tan ^{2}{\left (e + f x \right )}}{2 f} - C a c x + \frac{C a c \tan{\left (e + f x \right )}}{f} - \frac{C a d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{C a d \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac{C b c \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{C b c \tan ^{2}{\left (e + f x \right )}}{2 f} + C b d x + \frac{C b d \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac{C b d \tan{\left (e + f x \right )}}{f} & \text{for}\: f \neq 0 \\x \left (a + b \tan{\left (e \right )}\right ) \left (c + d \tan{\left (e \right )}\right ) \left (A + B \tan{\left (e \right )} + C \tan ^{2}{\left (e \right )}\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Piecewise((A*a*c*x + A*a*d*log(tan(e + f*x)**2 + 1)/(2*f) + A*b*c*log(tan(e + f*x)**2 + 1)/(2*f) - A*b*d*x + A
*b*d*tan(e + f*x)/f + B*a*c*log(tan(e + f*x)**2 + 1)/(2*f) - B*a*d*x + B*a*d*tan(e + f*x)/f - B*b*c*x + B*b*c*
tan(e + f*x)/f - B*b*d*log(tan(e + f*x)**2 + 1)/(2*f) + B*b*d*tan(e + f*x)**2/(2*f) - C*a*c*x + C*a*c*tan(e +
f*x)/f - C*a*d*log(tan(e + f*x)**2 + 1)/(2*f) + C*a*d*tan(e + f*x)**2/(2*f) - C*b*c*log(tan(e + f*x)**2 + 1)/(
2*f) + C*b*c*tan(e + f*x)**2/(2*f) + C*b*d*x + C*b*d*tan(e + f*x)**3/(3*f) - C*b*d*tan(e + f*x)/f, Ne(f, 0)),
(x*(a + b*tan(e))*(c + d*tan(e))*(A + B*tan(e) + C*tan(e)**2), True))

________________________________________________________________________________________

Giac [B]  time = 3.87224, size = 3939, normalized size = 24.47 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*tan(f*x+e))*(c+d*tan(f*x+e))*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/6*(6*A*a*c*f*x*tan(f*x)^3*tan(e)^3 - 6*C*a*c*f*x*tan(f*x)^3*tan(e)^3 - 6*B*b*c*f*x*tan(f*x)^3*tan(e)^3 - 6*B
*a*d*f*x*tan(f*x)^3*tan(e)^3 - 6*A*b*d*f*x*tan(f*x)^3*tan(e)^3 + 6*C*b*d*f*x*tan(f*x)^3*tan(e)^3 - 3*B*a*c*log
(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*t
an(e) + 1))*tan(f*x)^3*tan(e)^3 - 3*A*b*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + ta
n(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 + 3*C*b*c*log(4*(tan(e)^2 + 1)/(t
an(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)
^3*tan(e)^3 - 3*A*a*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 +
tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 + 3*C*a*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 -
 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 + 3*B*b*
d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f
*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 18*A*a*c*f*x*tan(f*x)^2*tan(e)^2 + 18*C*a*c*f*x*tan(f*x)^2*tan(e)^2 + 1
8*B*b*c*f*x*tan(f*x)^2*tan(e)^2 + 18*B*a*d*f*x*tan(f*x)^2*tan(e)^2 + 18*A*b*d*f*x*tan(f*x)^2*tan(e)^2 - 18*C*b
*d*f*x*tan(f*x)^2*tan(e)^2 + 3*C*b*c*tan(f*x)^3*tan(e)^3 + 3*C*a*d*tan(f*x)^3*tan(e)^3 + 3*B*b*d*tan(f*x)^3*ta
n(e)^3 + 9*B*a*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f
*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 + 9*A*b*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*ta
n(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 9*C*b*c*log
(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*t
an(e) + 1))*tan(f*x)^2*tan(e)^2 + 9*A*a*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + ta
n(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 9*C*a*d*log(4*(tan(e)^2 + 1)/(t
an(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)
^2*tan(e)^2 - 9*B*b*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 +
tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 6*C*a*c*tan(f*x)^3*tan(e)^2 - 6*B*b*c*tan(f*x)^3*ta
n(e)^2 - 6*B*a*d*tan(f*x)^3*tan(e)^2 - 6*A*b*d*tan(f*x)^3*tan(e)^2 + 6*C*b*d*tan(f*x)^3*tan(e)^2 - 6*C*a*c*tan
(f*x)^2*tan(e)^3 - 6*B*b*c*tan(f*x)^2*tan(e)^3 - 6*B*a*d*tan(f*x)^2*tan(e)^3 - 6*A*b*d*tan(f*x)^2*tan(e)^3 + 6
*C*b*d*tan(f*x)^2*tan(e)^3 + 18*A*a*c*f*x*tan(f*x)*tan(e) - 18*C*a*c*f*x*tan(f*x)*tan(e) - 18*B*b*c*f*x*tan(f*
x)*tan(e) - 18*B*a*d*f*x*tan(f*x)*tan(e) - 18*A*b*d*f*x*tan(f*x)*tan(e) + 18*C*b*d*f*x*tan(f*x)*tan(e) + 3*C*b
*c*tan(f*x)^3*tan(e) + 3*C*a*d*tan(f*x)^3*tan(e) + 3*B*b*d*tan(f*x)^3*tan(e) - 3*C*b*c*tan(f*x)^2*tan(e)^2 - 3
*C*a*d*tan(f*x)^2*tan(e)^2 - 3*B*b*d*tan(f*x)^2*tan(e)^2 + 3*C*b*c*tan(f*x)*tan(e)^3 + 3*C*a*d*tan(f*x)*tan(e)
^3 + 3*B*b*d*tan(f*x)*tan(e)^3 - 2*C*b*d*tan(f*x)^3 - 9*B*a*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*ta
n(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 9*A*b*c*log(4*(
tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e
) + 1))*tan(f*x)*tan(e) + 9*C*b*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2
*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 9*A*a*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*ta
n(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 9*
C*a*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*t
an(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 9*B*b*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e)
 + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 12*C*a*c*tan(f*x)^2*tan(e) + 1
2*B*b*c*tan(f*x)^2*tan(e) + 12*B*a*d*tan(f*x)^2*tan(e) + 12*A*b*d*tan(f*x)^2*tan(e) - 18*C*b*d*tan(f*x)^2*tan(
e) + 12*C*a*c*tan(f*x)*tan(e)^2 + 12*B*b*c*tan(f*x)*tan(e)^2 + 12*B*a*d*tan(f*x)*tan(e)^2 + 12*A*b*d*tan(f*x)*
tan(e)^2 - 18*C*b*d*tan(f*x)*tan(e)^2 - 2*C*b*d*tan(e)^3 - 6*A*a*c*f*x + 6*C*a*c*f*x + 6*B*b*c*f*x + 6*B*a*d*f
*x + 6*A*b*d*f*x - 6*C*b*d*f*x - 3*C*b*c*tan(f*x)^2 - 3*C*a*d*tan(f*x)^2 - 3*B*b*d*tan(f*x)^2 + 3*C*b*c*tan(f*
x)*tan(e) + 3*C*a*d*tan(f*x)*tan(e) + 3*B*b*d*tan(f*x)*tan(e) - 3*C*b*c*tan(e)^2 - 3*C*a*d*tan(e)^2 - 3*B*b*d*
tan(e)^2 + 3*B*a*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan
(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 3*A*b*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) +
tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) - 3*C*b*c*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2
 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 3*A*a*d*log(4*(tan(e)^2
+ 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) -
 3*C*a*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 -
2*tan(f*x)*tan(e) + 1)) - 3*B*b*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2
*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) - 6*C*a*c*tan(f*x) - 6*B*b*c*tan(f*x) - 6*B*a*d*tan(f*x) - 6*
A*b*d*tan(f*x) + 6*C*b*d*tan(f*x) - 6*C*a*c*tan(e) - 6*B*b*c*tan(e) - 6*B*a*d*tan(e) - 6*A*b*d*tan(e) + 6*C*b*
d*tan(e) - 3*C*b*c - 3*C*a*d - 3*B*b*d)/(f*tan(f*x)^3*tan(e)^3 - 3*f*tan(f*x)^2*tan(e)^2 + 3*f*tan(f*x)*tan(e)
 - f)